package com.framework.service.core.service;



import com.framework.common.domain.WechatMessage;
import com.framework.core.api.response.WxGeneralToken;
import com.framework.core.api.response.WxUserInfo;
import com.framework.core.api.response.WxUserOpenIdRes;

/**
 * @author zhoubb
 * @version V1.0
 * @Date 2020/4/12 21:53
 * @since JDK 1.8
 */
public interface IWeixinService {

     /**
      * 根据code获取openid和sessionkey
      * @param code
      * @return
      */
     WxUserOpenIdRes getWeixinOpenidAndKey(String code);

     /**
      * 获取微信token
      * @return
      */
     WxGeneralToken getWeixinAccessToken(String userType);

     /**
      * 获取微信用户信息
      * @param userType
      * @param openId
      * @return
      */
     WxUserInfo getWeixinUserInfo(String accessToken, String openId);

     /**
      * 解密微信用户手机号
      * @param encryptedData 加密数据
      * @param sessionKey
      * @param iv 偏移量
      * @return
      */
     String getPhoneNumberFromWeixin(String encryptedData, String sessionKey, String iv);

     /**
      * 公众号关注事件
      * @param wechatMessage
      * @return
      */
     String subscribe( WechatMessage wechatMessage);
}
